<?php

class Application_Form_User extends Zend_Form
{
    public function init()
    {
        $this->setName('User');
        
        $user_id = new Zend_Form_Element_Hidden('user_id');
        $user_id->addFilter('Int');
		
		$role_id = new Zend_Form_Element_Select('role_id');
        $role_id->setLabel('Role:')
        					
        		 ->setRequired(true)
                ->addMultiOptions(array(
                 	'0' => 'Admin',
                	'1' => 'Editor',
                	'2' => 'Client'
        ));

        $user_name = new Zend_Form_Element_Text('user_name');
        $user_name->setLabel('User Name:')
              ->setRequired(true)
              ->addFilter('StripTags')
              ->addFilter('StringTrim')
              ->addValidator('NotEmpty');
              
        $password = new Zend_Form_Element_Password('password');
        $password->setLabel('Password:')
               ->setRequired(true)
               ->addFilter('StripTags')
               ->addFilter('StringTrim')
               ->addValidator('NotEmpty');
               
        $full_name = new Zend_Form_Element_Text('full_name');
        $full_name->setLabel('Full Name:')
         //      ->setRequired(true)
               ->addFilter('StripTags')
               ->addFilter('StringTrim')
               ->addValidator('NotEmpty');
               
        $email = new Zend_Form_Element_Text('email');
        $email->setLabel('Email:')
               ->setRequired(true)
               ->addFilter('StripTags')
               ->addFilter('StringTrim')
               ->addValidator('NotEmpty');

//        $is_active = new Zend_Form_Element_Text('is_active');
//        $is_active->setLabel('Is Active:')
//        					  ->addFilter('Int');
//        					  
//               
//       	$is_online = new Zend_Form_Element_Text('is_online');
//        $is_online->setLabel('Is Online:')
//        					  ->addFilter('Int');
        					  
        $submit = new Zend_Form_Element_Submit('submit');
        $submit->setAttrib('id', 'AddButton');

        $cancel = new Zend_Form_Element_Submit('cancel');
        $cancel->setAttrib('id', 'CancelButton');

        $this->addElements(array($user_id, $role_id, $user_name, $password, $full_name, $email , $submit, $cancel));
    }
}